<?php
    $url = new Url(); 
    $forder_upload = "ringBack";  
    $link_avatar = Yii::app()->params["urlImages"]."upload_avatar.php?forder_upload=".$forder_upload; 
?>
<link rel="stylesheet" href="<?php echo Yii::app()->params['urlImages']; ?>lib_upload/css/swfupload.css" type="text/css" />
<script type="text/javascript" src="<?php echo Yii::app()->params['urlImages']; ?>lib_upload/js/swfupload.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->params['urlImages']; ?>lib_upload/js/swfupload.queue.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->params['urlImages']; ?>lib_upload/js/fileprogress.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->params['urlImages']; ?>lib_upload/js/handlers.js"></script>
<script type="text/javascript">
    function ajaxUpdateSingerRing(){
        var id = '<?php echo $data["id"]?>';
        var name = $("#name").val();  
        //alert(singer);return;
        var strUrl = "<?=$url->createUrl("ringBack/ajaxUpdateSingerRing") ?>";  
        $.ajax({
            type: "POST",
            url: strUrl,
            data: {
                id:id,
                name:name,   
            },
            success: function(msg){
                if(msg == 1){
                    alert('Sửa thành công');
                    history.go(-1);
                }else{
                    $("#show_error").html(msg);
                }
            },
            beforeSend:function(){
                $("#button_save").attr("disabled","disabled");
            },
            complete:function(){
                $("#button_save").removeAttr("disabled"); 
            }          
        });
    }
</script>
<div class="main clearfix">
    <div class="box clearfix bottom30">
        <ul class="form4">
            <li class="clearfix"><label><strong>Tên ca sĩ, nhóm nhạc </strong>:</label>
                <div class="filltext">
                    <input type="text" style="width:360px" value="<?php echo $data["name"]?>" id="name" maxlength="40"> 
                </div>
            </li>
            <li class="clearfix"><label>&nbsp;</label>
                <div class="filltext">
                    <input type="button" id="button_save" value=" Sửa " class="btn-bigblue" onclick="ajaxUpdateSingerRing();"> 
                    &nbsp;
                    <input onclick="history.go(-1)" type="button" value=" Quay lại " class="btn-bigblue">
                </div>
            </li>
            <li class="clearfix"><label>&nbsp;</label>
                <div class="filltext" style="color: red;" id="show_error"></div>
            </li>
        </ul>
    </div>
</div>